package com.example.droolstest.controller;

import com.example.droolstest.entity.req.ExecuteRuleReq;
import com.example.droolstest.service.DroolsService;
import com.example.droolstest.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/drools")
public class DroolsController {

    @Autowired
    private DroolsService droolsService;

    @PostMapping("/execute")
    public AjaxResult executeRule(@RequestBody ExecuteRuleReq executeRule) {
        return AjaxResult.success(droolsService.execute(executeRule));
    }

}
